#include <string>

#pragma once

using namespace std;

struct Token {
	enum TTokenType {
		TT_BinaryAdd,
		TT_BinarySubtract,
		TT_Mult,
		TT_Div,
		TT_OpenBracket,
		TT_CloseBracket,
		TT_Number,
		TT_Count
	};
	TTokenType Type;
	double Value;

	Token() : Value(0), Type(TT_Count) {}
};

class Tokenizer {
public:
	Tokenizer(const char* input) : inputString(input), position(0) {}
	Token GetToken();
	bool PeekToken(Token& token) const;
	bool IsEnd() const;

private:
	string inputString;
	int position;

	bool peekToken(Token& token, int& newPos) const;
};